package indi.gao;

import cn.hutool.core.lang.UUID;
import com.alibaba.fastjson.JSONObject;

import java.util.*;
import java.util.stream.Collectors;

/**
 * <p>Description:</p>
 * <p>Copyright: Copyright (c)2020$</p>
 * <p>Company: Tope</p>
 * <P>Created Date :2020$-04$-09$</P>
 * <P>@version 1.0</P>
 */
public class StreamTest {
    public static void main(String[] args) {
        List<Apple> objects = new ArrayList<>();
        Apple app1 = new Apple("1");
        app1.setAge(0);
        Apple app2 = new Apple("1");
        app2.setAge(1);
        Apple app3 = new Apple("1");
        app3.setAge(2);
        objects.add(app1);
        objects.add(app2);
        objects.add(app3);

        List<Apple> collect = objects.stream().filter(x -> x.getAge() == 0).collect(Collectors.toList());
        List<Apple> collect1 = objects.stream().filter(x -> x.getAge() == 2).collect(Collectors.toList());

        System.out.println(collect);
        System.out.println(collect1);


        HashMap<String, Object> stringObjectHashMap = new HashMap<>();
        stringObjectHashMap.get("name");


        System.out.println(4294967295l / 1000 / 3600);
        System.out.println(Integer.MAX_VALUE);

        for (int i = 0; i < 100; i++) {
            System.out.println(Math.abs(UUID.randomUUID().toString().hashCode()));
        }
        // 库
        System.out.println(325508/64%64);
        // 表
        System.out.println(135952716%64);

        Peer peer = new Peer();
        peer.setAge(1);

        System.out.println(JSONObject.toJSONString(peer));

        Peer peer1 = JSONObject.parseObject("{\"string\":\"1234\"}", Peer.class);
        System.out.println(peer1);





    }
}


